#ifndef __MTECHINQUE_H__
#define __MTECHINQUE_H__

#include <string>

#define MAXPASSES 5

class CMPass;
class CMMaterial;


class CMTechnique
{
	
public:

	// constructor
	CMTechnique( CMMaterial* Parent );
	CMTechnique( CMMaterial* Parent , const CMTechnique& t );

	// destructor
	~CMTechnique( void );

	// Creates a new Pass for this Technique.
	// A Pass is a single rendering pass, ie a single draw of the given material.
	CMPass* CreatePass( void );

	// Retrieves the Pass with the given index.
	CMPass* GetPass( unsigned int uiIndex );

	// Retrieves the number of passes.
	unsigned int GetNumPasses( void ) const;

	// Removes the Pass with the given index.
	void RemovePass( unsigned int uiIndex );

	// Removes all Passes from this Technique.
	void RemoveAllPasses( void );

	// Overloaded operator to copy on Technique to another.
	CMTechnique& operator=( const CMTechnique& rhs );

	// Internal load method, derived from call to Material::Load.
	void Load( void );

	// Internal unload method, derived from call to Material::Unload.
	void Unload( void );

	// Returns true if this Technique involves transparency. 
	bool IsTransparent( void ) const;

	
	// Gets the resource group of the ultimate parent Material
	const std::string GetResourceGroup( void ) const;

	
protected:

	// material
	CMMaterial*  m_ParentMaterial;

	// number of passes
	unsigned int m_uiNumOfPasses;

	// passes
	CMPass* m_ppPasses[MAXPASSES];
};

#endif